package com.kofigyan.stateprogressbarsample;

import com.kofigyan.stateprogressbar.StateProgressBar;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Button;
import ohos.agp.components.Component;

public abstract class UsageBaseActivity extends BaseAbility
        implements Component.ClickedListener {

    protected String[] descriptionData = {"Details", "Pricing", "Amenities", "Status"};
    protected Button nextBtn;
    protected Button backBtn;
    protected StateProgressBar stateProgressBar;

    @Override
    protected void onStart(Intent intent) {
        super.onStart(intent);
        actionBar.getRightView().setVisibility(Component.INVISIBLE);
        injectCommonViews();
    }

    protected void injectCommonViews() {
        nextBtn = (Button) findComponentById(ResourceTable.Id_btnNext);
        nextBtn.setClickedListener(this);

        stateProgressBar =
                (StateProgressBar) findComponentById(ResourceTable.Id_usage_stateprogressbar);
        stateProgressBar.setStateDescriptionData(descriptionData);
    }

    protected void injectBackView() {
        backBtn = (Button) findComponentById(ResourceTable.Id_btnBack);
        backBtn.setClickedListener(this);
    }
}
